<?php

class StudyService
{

    /*
    * 是否已经点赞对象
    *
    */
    public static function isStarBefore($study_id,$user_id)
    {
        $starobj = StudyStar::model()->find("study_id='".$study_id."' and user_id='".$user_id."' order by create_time desc");


       // Util::responseObj($starobj);

       // return;


        if(empty($starobj)==true)
            return false;

        if($starobj->is_delete == 0)
            return true;

        return false;



    }

    /*
    * 获取点赞对象
    *
    */
    public static function getStarObj($study_id,$user_id)
    {

        $starobj = StudyStar::model()->find("study_id=".$study_id." and user_id=".$user_id);

        return $starobj;


    }




}



?>